import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class GeneratePassword {
    public static void main(String[] args) {
        String password = "admin123";
        
        // Generate MD5 hash
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] hashBytes = md.digest(password.getBytes());
            String md5Hash = bytesToHex(hashBytes);
            System.out.println("MD5 hash for 'admin123': " + md5Hash);
        } catch (NoSuchAlgorithmException e) {
            System.out.println("MD5 algorithm not available");
        }
        
        // Generate SHA-256 hash
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            byte[] hashBytes = md.digest(password.getBytes());
            String sha256Hash = bytesToHex(hashBytes);
            System.out.println("SHA-256 hash for 'admin123': " + sha256Hash);
        } catch (NoSuchAlgorithmException e) {
            System.out.println("SHA-256 algorithm not available");
        }
        
        // Generate Base64 encoding
        String base64Password = Base64.getEncoder().encodeToString(password.getBytes());
        System.out.println("Base64 for 'admin123': " + base64Password);
        
        // Common password hashes for testing
        System.out.println("\nCommon password hashes:");
        System.out.println("admin123 (MD5): 0192023a7bbd73250516f069df18b500");
        System.out.println("admin123 (SHA-1): 40bd001563085fc35165329ea1ff5c5ecbdbbeef");
    }
    
    private static String bytesToHex(byte[] bytes) {
        StringBuilder result = new StringBuilder();
        for (byte b : bytes) {
            result.append(String.format("%02x", b));
        }
        return result.toString();
    }
}
